<!DOCTYPE html>
<html>

<head>

    {include file="Public/header"}
     <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <style>
        .row {
            padding: 0;
            margin: 0;
        }

        .clearFix::after {
            content: ".";
            clear: both;
            display: block;
            overflow: hidden;
            font-size: 0;
            height: 0;
        }

        .clearFix {
            zoom: 1;
        }

        .colorRed {
            color: red;
        }

        .col3 {
            padding: 10px 0;
            width: 20%;
            float: left;
        }

        .col3 {
            padding: 10px 0;
            width: 30%;
            float: left;
        }

        .textR {
            text-align: right;
        }
    </style>

</head>

<body class="white-bg">
<div class="container white-bg" style="padding:0;margin:0 auto">
  <div class="page-heade">
       <h2 class="title_color text-center">请选择系统对应的经销商</h2>
    </div>
    <form action="" method="post" id="add">
    <table class="table table-bordered da_table white-bg" style="margin-bottom:0">
        <tr>
            <td class="textR">销售分区</td>
            <td>
                <select name="zoning" id="zoning" class="select1 form-control">
                    <option value="">请选择</option>
                    {volist name="zoning" id="row"}
                    <option value="{$row.id}">{$row.title}</option>
                    {/volist}
                </select>
            </td>
            <td class="textR">销售省</td>
            <td>
                <select name="provice" id="provice" class="select1 form-control">
                    <option value="">请选择</option>
                </select>
            </td>
        </tr>
        <tr>
            <td class="textR">销售市</td>
            <td>
                <select name="city" id="city" class="select1 form-control">
                    <option value="0">请选择</option>
                    <option value="1">某某1</option>
                    <option value="2">某某2</option>
                </select>
            </td>
            <td class="textR">经销商名称</td>
            <td>
                <select name="jxs" id="jxs" class="select2 form-control">
                    <option value="0">请选择</option>

                </select>
            </td>
        </tr>
    </table>
    </form>
    <div class="col-md-12 white-bg" style="padding: 20px 0;text-align: center;">
        <button class="btn btn-primary" id="tijiao">确认并提交</button>
    </div>
</div>

<!-- 全局js -->
{include file="Public/footer"}
<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>

<!-- 自定义js -->
<script src="__STATIC__/layout/js/content.js"></script>

<!-- 欢迎信息 -->
<script src="__STATIC__/layout/js/welcome.js"></script>
<script>
    $(function () {
        $('#zoning').on('change',function () {
            var id = $(this).val()
            $('#provice').load('{:url("Zcity/getprovices")}?id='+id)
        })
        $('#provice').on('change',function () {
            var id = $(this).val()
            $('#city').load('{:url("Jxsgl/getcities")}?id='+id)
        })
        $('#city').on('change',function () {
            var id = $(this).val()
            $('#jxs').load('{:url("getjxses")}?id='+id)
        })
        //提交
        $('#tijiao').on('click',function () {
            var form =  $('#add')
            var serial = form.serialize()
            $.ajax({
                'type':'post',
                'url':form.attr('action'),
                'data':serial,
                'dataType':'json',
                'success':function (data) {
                    if(data.success){
                        parent.location.href = '{:url("addviewnext")}?'+serial
                    }else
                        swal({
                            title: data.msg,
                            type: "warning"
                        });
                }
            })
            return false
        })
    })
</script>
</body>

</html>